let href = location.href;
function getUrldata(url){
    let reg = /^[^\s]+\?([^&\s\d]+=[^\s]+)*/
    let match = reg.exec(url)[1];
    if (!match) {//表示没匹配到
        console.warn("没有匹配到相应的query参数")
        return null
    }
    var queryArr=match.split("=");
    var queryobj={};
    queryobj[queryArr[0]]=queryArr[1];
    return queryobj;
}
let qr=getUrldata(href);
let {productid} = qr;
console.log(productid);
$.ajax({
    url:"http://chst.vip:1234/api/getmoneyctrlproduct",
    type:"Get",
    data:{
        productid
    }
}).then(res=>{
    var item=res.result[0];
    var html=`
    <h4>${item.productName}</h4>
    <p class="other"><span>${item.productFrom}|${item.productTime}</span><span>${item.productTips}</span></p>
    <div class="content">
        ${item.productImgSm}
        ${item.productInfo}
    </div>
    <div class="bigimg">
        ${item.productImgSm}
    </div>
    ${item.productCity}
    <section class="gobuy">
        <a href="#">前往购买</a>
    </section>
    <section class="erweima">
        <img src="http://chst.vip:8081/mmb/images/mmbweixin2.png" alt="">
    </section>
    ${item.productComment}
    `
    $("main").html(html)
})